package com.fang.shiyan;

public class Producer extends Thread {
    private Depository depository;



    public Producer(Depository depository) {
        this.setDaemon(true);
        this.depository = depository;
    }
    public void do_produce(){
        depository.produce();
    }

    @Override
    public void run() {
        while (true) {
            try {
                this.do_produce();
                Thread.sleep(3000);

            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
